#pragma once
#include "motion/rtcmds.h"
#include "zuc/nml_intf/zucpos.h"
#include "zuc/motion/motion.h"

/*****************************************************************************
 * 好像是没有用的指令
******************************************************************************/

#define USELESS_CMD_CLASS_NAME(x) CMD_CLASS_NAME(x) "[USELESS CMD]"

class CmdSetJointMinFerror : public mot::MultiRobCmd
{
public:
    CmdSetJointMinFerror(int grp_id, int joint_num, double minFerror)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetJointMinFerror);
        joint_num_ = joint_num;
        minFerror_ = minFerror;
    };
    ~CmdSetJointMinFerror() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
    double minFerror_;
};

class CmdJointUnhome : public mot::MultiRobCmd
{
public:
    CmdJointUnhome(int grp_id, int joint)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdJointUnhome);
        joint_num_ = joint;
    };
    ~CmdJointUnhome() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };
    int joint_num_;
};

class CmdJointHome : public mot::MultiRobCmd
{
public:
    CmdJointHome(int grp_id, int joint)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdJointHome);
        joint_num_ = joint;
    };
    ~CmdJointHome() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
};

class CmdMotorsServoOn : public mot::MultiRobCmd
{
public:
    CmdMotorsServoOn(int grp_id)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdMotorsServoOn);
    };
    ~CmdMotorsServoOn() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };
};

class CmdMotorsServoOff : public mot::MultiRobCmd
{
public:
    CmdMotorsServoOff(int grp_id)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdMotorsServoOff);
    };
    ~CmdMotorsServoOff() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };
};

class CmdJointActivate : public mot::MultiRobCmd
{
public:
    CmdJointActivate(int grp_id, int joint)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdJointActivate);
        joint_num_ = joint;
    };
    ~CmdJointActivate() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
};

class CmdJointDeactivate : public mot::MultiRobCmd
{
public:
    CmdJointDeactivate(int grp_id, int joint)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdJointDeactivate);
        joint_num_ = joint;
    };
    ~CmdJointDeactivate() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
};

class CmdSetJointHomingParams : public mot::MultiRobCmd
{
public:
    CmdSetJointHomingParams(int grp_id,
                            int joint_num,
                            int volatile_home,
                            double latch_vel,
                            double home_final_vel,
                            double home,
                            double search_vel,
                            double offset,
                            int homingflag,
                            int home_sequence)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetJointHomingParams);
        joint_num_ = joint_num;
        volatile_home_ = volatile_home;
        latch_vel_ = latch_vel;
        home_final_vel_ = home_final_vel;
        home_ = home;
        search_vel_ = search_vel;
        offset_ = offset;
        homingflag_ = homingflag;
        home_sequence_ = home_sequence;
    };
    ~CmdSetJointHomingParams() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
    int volatile_home_;
    double latch_vel_;
    double home_final_vel_;
    double home_;
    double search_vel_;
    double offset_;
    int homingflag_;
    int home_sequence_;
};

class CmdUpdateJointHomingParams : public mot::MultiRobCmd
{
public:
    CmdUpdateJointHomingParams(int grp_id, int joint_num, double offset, double home)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdUpdateJointHomingParams);
        joint_num_ = joint_num;
        offset_ = offset;
        home_ = home;
    };
    ~CmdUpdateJointHomingParams() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double offset_;
    double home_;
    int joint_num_;
};

class CmdOverrideLimits : public mot::MultiRobCmd
{
public:
    CmdOverrideLimits(int grp_id, int joint_num)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdOverrideLimits);
        joint_num_ = joint_num;
    };
    ~CmdOverrideLimits() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
};

class CmdSetAxisLockingJoint : public mot::MultiRobCmd
{
public:
    CmdSetAxisLockingJoint(int grp_id, int joint_num, int axis_num)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetAxisLockingJoint);
        joint_num_ = joint_num;
        axis_num_ = axis_num;
    };
    ~CmdSetAxisLockingJoint() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
    int axis_num_;
};

class CmdSetAxisPositionLimits : public mot::MultiRobCmd
{
public:
    CmdSetAxisPositionLimits(int grp_id, int axis_num, double maxLimit, double minLimit)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetAxisPositionLimits);
        axis_num_ = axis_num;
        maxLimit_ = maxLimit;
        minLimit_ = minLimit;
    };
    ~CmdSetAxisPositionLimits() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int axis_num_;
    double maxLimit_;
    double minLimit_;
};

class CmdSetAxisVelLimit : public mot::MultiRobCmd
{
public:
    CmdSetAxisVelLimit(int grp_id, int axis_num, double vel)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetAxisVelLimit);
        axis_num_ = axis_num;
        vel_ = vel;
    };
    ~CmdSetAxisVelLimit() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int axis_num_;
    double vel_;
};

class CmdSetAxisAccLimit : public mot::MultiRobCmd
{
public:
    CmdSetAxisAccLimit(int grp_id, int axis_num, double acc)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetAxisAccLimit);
        axis_num_ = axis_num;
        acc_ = acc;
    };
    ~CmdSetAxisAccLimit() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int axis_num_;
    double acc_;
};

class CmdSetMotorRatedcurr : public mot::MultiRobCmd
{
public:
    CmdSetMotorRatedcurr(int grp_id, const double* motorParam)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetMotorRatedcurr);
        for (int i = 0; i < 9; i++) { motorParam_[i] = motorParam[i]; }
    };
    ~CmdSetMotorRatedcurr() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double motorParam_[9];
};

class CmdSetMotorRatedtorq : public mot::MultiRobCmd
{
public:
    CmdSetMotorRatedtorq(int grp_id, const double* motorParam)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetMotorRatedtorq);
        for (int i = 0; i < 9; i++) { motorParam_[i] = motorParam[i]; }
    };
    ~CmdSetMotorRatedtorq() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double motorParam_[9];
};

class CmdSetMotorRatedtransratio : public mot::MultiRobCmd
{
public:
    CmdSetMotorRatedtransratio(int grp_id, const double* motorParam)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetMotorRatedtransratio);
        for (int i = 0; i < 9; i++) { motorParam_[i] = motorParam[i]; }
    };
    ~CmdSetMotorRatedtransratio() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double motorParam_[9];
};

class CmdSetRobotModel : public mot::MultiRobCmd
{
public:
    CmdSetRobotModel(int grp_id, int robot_model)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetRobotModel);
        robot_model_ = robot_model;
    };
    ~CmdSetRobotModel() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int robot_model_;
};

class CmdSetJointOffsetAndDir : public mot::MultiRobCmd
{
public:
    CmdSetJointOffsetAndDir(int grp_id, const double* offset, const int* dir)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetJointOffsetAndDir);
        for (int i = 0; i < 9; i++) { offset_[i] = offset[i]; }
        for (int i = 0; i < 9; i++) { dir_[i] = dir[i]; }
    };
    ~CmdSetJointOffsetAndDir() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double offset_[9];
    int dir_[9];
};

class CmdSetNumJoints : public mot::MultiRobCmd
{
public:
    CmdSetNumJoints(int grp_id, int joint_num) { joint_num_ = joint_num; };
    ~CmdSetNumJoints() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    int joint_num_;
};

class CmdSetDhParam : public mot::MultiRobCmd
{
public:
    CmdSetDhParam(int grp_id, const DHParam& dhParam)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetDhParam);
        dhParam_ = dhParam;
    };
    ~CmdSetDhParam() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    DHParam dhParam_;
};

class CmdSetDynParam : public mot::MultiRobCmd
{
public:
    CmdSetDynParam(int grp_id, const DynParam& dynParam)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetDynParam);
        dynParam_ = dynParam;
    };
    ~CmdSetDynParam() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    DynParam dynParam_;
};

class CmdSetJointAccLimit : public mot::MultiRobCmd
{
public:
    CmdSetJointAccLimit(int grp_id, int joint_num, double acc)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetJointAccLimit);
        acc_ = acc;
        joint_num_ = joint_num;
    };
    ~CmdSetJointAccLimit() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double acc_;
    int joint_num_;
};

class CmdSetInitPose : public mot::MultiRobCmd
{
public:
    CmdSetInitPose(int grp_id, const double* trajInitPosj)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetInitPose);
        for (int i = 0; i < 9; i++) { trajInitPosj_[i] = trajInitPosj[i]; }
    };
    ~CmdSetInitPose() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double trajInitPosj_[9];
};

class CmdSetInitPoseTol : public mot::MultiRobCmd
{
public:
    CmdSetInitPoseTol(int grp_id, double tol)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetInitPoseTol);
        tol_ = tol;
    };
    ~CmdSetInitPoseTol() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double tol_;
};

class CmdSetRobotBaseOffset : public mot::MultiRobCmd
{
public:
    CmdSetRobotBaseOffset(int grp_id, zuc_traj_setbaseoffset_t trajsetbaseoffset)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetRobotBaseOffset);
        trajsetbaseoffset_ = trajsetbaseoffset;
    };
    ~CmdSetRobotBaseOffset() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    zuc_traj_setbaseoffset_t trajsetbaseoffset_;
};

class CmdSetVel : public mot::MultiRobCmd
{
public:
    CmdSetVel(int grp_id, double ini_maxvel, double vel)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetVel);
        ini_maxvel_ = ini_maxvel;
        vel_ = vel;
    };
    ~CmdSetVel() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double ini_maxvel_;
    double vel_;
};

class CmdSetVelLimit : public mot::MultiRobCmd
{
public:
    CmdSetVelLimit(int grp_id, double vel)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetVelLimit);
        vel_ = vel;
    };
    ~CmdSetVelLimit() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double vel_;
};

class CmdSetAcc : public mot::MultiRobCmd
{
public:
    CmdSetAcc(int grp_id, double acc)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetAcc);
        acc_ = acc;
    };
    ~CmdSetAcc() {}

    virtual int active_callback() { return 0; };
    virtual int process();
    virtual int check_para() { return 0; };

    double acc_;
};

class CmdSetMaxJointJerk : public mot::MultiRobCmd
{
public:
    CmdSetMaxJointJerk(int grp_id, double Jerk)
    {
        group_id_ = grp_id;
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetMaxJointJerk);
        joint_Jerk_ = Jerk;
    };
    ~CmdSetMaxJointJerk() {}

    virtual int active_callback() { return 0; };
    int process() override;
    virtual int check_para() { return 0; };

    int joint_Jerk_;
};

class CmdSetMaxCarteJerk : public mot::MultiRobCmd
{
public:
    CmdSetMaxCarteJerk(int grp_id, double Jerk)
    {
        cmd_name_ = USELESS_CMD_CLASS_NAME(CmdSetMaxCarteJerk);
        carte_Jerk_ = Jerk;
    };
    ~CmdSetMaxCarteJerk() {}

    virtual int active_callback() { return 0; };
    int process() override;
    virtual int check_para() { return 0; };

    int carte_Jerk_;
};
